// ============================================================================
//
// Copyright (C) 2009-2010 Gomai Inc. - www.mysoftlife.com
//
// ============================================================================
package com.sc.vessel.info.editor;

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IPersistableElement;

import com.sc.vessel.info.model.breakdown.Accident;

/**
 * DOC liaoqc class global comment. Detailled comment
 */
public class InfoInput implements IEditorInput {

    private Accident accident;

    private boolean changed;

    /**
     * DOC liaoqc InfoInput constructor comment.
     * 
     * @param name
     */
    public InfoInput(Accident accident) {
        super();
        this.accident = accident;
    }

    /*
     * (non-Javadoc)
     * 
     * @see org.eclipse.ui.IEditorInput#exists()
     */
    @Override
    public boolean exists() {
        // TODO Auto-generated method stub
        return false;
    }

    /*
     * (non-Javadoc)
     * 
     * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
     */
    @Override
    public ImageDescriptor getImageDescriptor() {
        // TODO Auto-generated method stub
        return null;
    }

    /*
     * (non-Javadoc)
     * 
     * @see org.eclipse.ui.IEditorInput#getName()
     */
    @Override
    public String getName() {
        return "";
    }

    /*
     * (non-Javadoc)
     * 
     * @see org.eclipse.ui.IEditorInput#getPersistable()
     */
    @Override
    public IPersistableElement getPersistable() {
        // TODO Auto-generated method stub
        return null;
    }

    /*
     * (non-Javadoc)
     * 
     * @see org.eclipse.ui.IEditorInput#getToolTipText()
     */
    @Override
    public String getToolTipText() {
        return "";
    }

    /*
     * (non-Javadoc)
     * 
     * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
     */
    @SuppressWarnings("rawtypes")
    @Override
    public Object getAdapter(Class adapter) {
        // TODO Auto-generated method stub
        return null;
    }

    /*
     * (non-Javadoc)
     * 
     * @see java.lang.Object#equals(java.lang.Object)
     */
    @Override
    public boolean equals(Object obj) {
        if (super.equals(obj)) {
            return true;
        }
        if (obj instanceof InfoInput) {
            return accident.getItemId().equals(((InfoInput) obj).getAccident().getItemId());
        }
        return false;
    }

    /*
     * (non-Javadoc)
     * 
     * @see java.lang.Object#hashCode()
     */
    @Override
    public int hashCode() {
        return accident.hashCode();
    }

    /**
     * Getter for accident.
     * 
     * @return the accident
     */
    public Accident getAccident() {
        return this.accident;
    }

    /**
     * Getter for changed.
     * 
     * @return the changed
     */
    public boolean isChanged() {
        return this.changed;
    }

    /**
     * Sets the changed.
     * 
     * @param changed the changed to set
     */
    public void setChanged(boolean changed) {
        this.changed = changed;
    }

}
